<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>

<Script runat="server">
  Public Sub Page_Load(sender As Object, e As EventArgs)
    Dim connection As SqlConnection
    Dim command As SqlCommand
    Dim reader As SqlDataReader
    Dim sqlSelect As String
    Dim strConn = _
	ConfigurationSettings.appSettings("conn")
    sqlSelect="Select * From tblSubCategory"
    sqlSelect +=" where SubCateID>10"    
    connection = New SqlConnection(myConnection )
    command = New SqlCommand(sqlSelect, connection)
    connection.Open()
    reader = command.ExecuteReader()
    datagrid1.DataSource = reader
    datagrid1.DataBind(_
    connection.Close()
  End Sub

</Script>
<asp:datagrid id="datagrid1" runat="server" />
